package com.adobe.coreUI.controls.whiteboardClasses
{
	/**
	 * Descriptor class for a shape
	 * 
	 * @see com.adobe.coreUI.controls.WhiteBoard
	 */
	public class WBShapeDescriptor
	{
		/**
		 * Factory class defining which type or class of shape
		 */
		public var factoryID:String;
		/**
		 * Definition date for this shape
		 */
		public var definitionData:*;
		/**
		 * Unique Shape Id
		 */
		public var shapeID:String;
		/**
		 * X-coordinate
		 */
		public var x:Number;
		/**
		 * Y-coordinate
		 */
		public var y:Number;
		/**
		 *  Width of this shape
		 */
		public var width:Number;
		/**
		 * Height of this shape
		 */
		public var height:Number;
		/**
		 * Rotation of shape , default is 0
		 */
		public var rotation:int=0;
		/**
		 * Property data for this shape
		 */
		public var propertyData:*;
		
		/**
		 * @private
		 */
		public function clone():WBShapeDescriptor
		{
			var retObj:WBShapeDescriptor = new WBShapeDescriptor();
			retObj.factoryID = factoryID;
			retObj.definitionData = definitionData;
			retObj.shapeID = shapeID;
			retObj.x = x;
			retObj.y = y;
			retObj.width = width;
			retObj.height = height;
			retObj.rotation = rotation;
			retObj.propertyData = propertyData;
			
			return retObj;
		}
		
		/**
		 * @private
		 */
		public function createValueObject():Object
		{
			var retObj:Object = new Object();
			retObj.factoryID = factoryID;
			retObj.definitionData = definitionData;
			retObj.shapeID = shapeID;
			retObj.x = x;
			retObj.y = y;
			retObj.width = width;
			retObj.height = height;
			retObj.rotation = rotation;
			retObj.propertyData = propertyData;
			
			return retObj;
		}
		
		/**
		 * @private
		 */
		public function readValueObject(p_vo:Object):void
		{
			for (var i:String in p_vo) {
				this[i] = p_vo[i];
			}
		}
	}
}